<template>
  <main class="wss-container">
    <ComTabs
      @EventSelectTab="currentSelect"
      :activeName="activeName"
      :tabList="tabList"
    ></ComTabs>
    <Organization v-if="activeName == 'organization'"></Organization>
    <Requirement v-else-if="activeName == 'requirement'"></Requirement>
  </main>
</template>

<script>
import ComTabs from "@/wss/components/ComTabs.vue";
import Organization from './organization/index.vue'
import Requirement from './requirement/index.vue'
export default {
  components: { ComTabs, Organization, Requirement },
  data() {
    return {
      activeName: "organization",
      // tab页数据
      tabList: [
        {
          label: "贷款机构",
          name: "organization",
        },
        {
          label: "贷款需求",
          name: "requirement",
        },
      ],
    };
  },
  methods: {
    currentSelect({ label, index, name }) {
      this.activeName = name;
    },
  },
};
</script>

<style scoped>
.wss-container {
  display: flex;
  flex-direction: column;
}
.wss-container .el-tabs {
  height: 40px;
  margin-bottom: 20px;
}

.wss-container .organization-box,
.wss-container .requirement-box {
  height: calc(100% - 60px);
  margin-bottom: 0;
  position: relative;
}
</style>